package com.tbit.uqbike.client.ordertrace.validation;

import com.tbit.uqbike.client.ordertrace.*;

/**
 * 规则校验器工厂
 *
 *
 * @author <a href="mailto:chen.chaoxiong@tbit.com.cn">ChenChaoXiong</a>
 * @since 2024/7/18
 */
public class ValidatorFactory {

    public static TransitionValidator createValidator(RuleType ruleType, String rule) {
        if (ruleType == null) {
            return new NoOpTransitionValidator();
        }
        switch (ruleType) {
            case JSON_SCHEMA:
                return new JsonSchemaTransitionValidator(rule);
            case JAVA:
                break;
            case GROOVY:
                break;
            case REGEX:
                break;
            default:
                throw new IllegalArgumentException("不支持的规则类型");
        }
        throw new UnSupportRuleTypeException("尚未实现的规则类型");
    }
}
